<%--
*@Description 
*@Author KingTeng
*@Date 2022/3/13
*@Time 14:16
--%>
<html>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false"%>

<%@include file="header.jsp"%>
<%@include file="top.jsp"%>

<body>
<table class="table table-bordered">

    <li>
        <br/><br/>
        <h1>
            中高危地区管理
        </h1>
        <div>
            <table class="table">
                <thead>
                <tr>
                    <th>地区</th>
                    <th>等级</th>
                </tr>
                </thead>
                <tbody>
                <c:forEach items="${dangers}" var="danger" >
                    <tr>
                        <td>${danger.city}</td>

                        <c:if test="${danger.lv==2}">
                            <td bgcolor="orange">中危地区</td>
                        </c:if>
                        <c:if test="${danger.lv==3}">
                            <td bgcolor="red">高危地区</td>
                        </c:if>

                        <td>
                            <a href="${pageContext.request.contextPath}/DeleteDanger?city=${danger.city}">删除</a>
                        </td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
        </div>
    </li>
</table>

<br>

<form method="post" action="AddDanger" class="registerForm" >
    <label>
        <td >地区名 ：</td>
        <td ><input id="city"  name="city" placeholder="输入地区名" > </td>
    </label>

    <label>
        <span>等级 :</span>
        <select id="lv" name="lv" type="text">
            <option>中风险</option>
            <option>高风险</option>
        </select>
    </label>

    <label>
        <td colspan="2">
            <a><button type="submit">新增</button></a>
        </td>
    </label>
</form>
</body>
</html>
